Why the Internet Needs Mutation Observers

How Banking Websites Can Help Stop Refund Scams

Table of Contents:
Last revision: 07JUL19

Anatomy of a Scam (Inspect Element Method)

  1. Victim receives call in which the scammer claims that he is from a reputable company (usually Microsoft).
  2. The scammer, usually with an obvious Indian accent, provides an American sounding name, and says that the victim is eligible for a refund from their alleged company. The scammer offers to give this refund himself.
  3. The scammer gets the victim to install and use Google Chrome.
  4. The scammer gets the victim to download some Remote Desktop client such as TeamViewer to allow the scammer access to the victim's computer.
  5. The scammer gets the victim to login to the victim's bank and permit the scammer to connect via the aforementioned client.
  6. The scammer, now having access to the victim's computer, tells the victim to look away, and then the magic starts.
  7. The scammer right clicks the bank account and hits "Inspect Element," which lets them edit the HTML.
  8. The scammer types in the original number, plus some number much larger than the agreed upon amount.
  9. The scammer permits the victim to see the amount, telling them that they have refunded them too much money. They then urge the victim to pay them back the amount minus the refund. This is, of course, money that the victim does not have.
  10. The scammer, upon receiving payment, hangs up, and the victim usually doesn't notice until much later.

How to Detect "Inspect Element" Tampering

Fortunately, web designers for online banking can detect tampering using a JavaScript API called Mutation Observers, which has been available since IE11. In short, Mutation Observers watch for changes in the HTML DOM and triggers callbacks when this happens. As an example, try using the Inspect Element trick on the number below. There is also a script that increments the value every 5 seconds, so be quick! This shows that you can still set the innerHTML with JavaScript/jQuery yourself, while still detecting Inspect Element changes. That way you can still use AJAX to refresh the values. This works because when jQuery does it, it triggers a mutation of type childList instead of characterData.

Demo:
Bank Acct 1 amount: $30000.00

And here is the source code for it:

			
		

You can close the tab, lock the customer out, or prevent changes altogether. (As a side note, the alert box does not block the inspector. If you want to undo any inspect-element changes, don't use an alert box.)

Alternative Method: Interfund Tranfser (IFT) Method

This is an alternative to the first method, which is slightly less subtle, but worth mentioning as it bypasses the detection method above.
  1. Instead of using "Inspect Element," the scammer transfers funds in between accounts, distracting the victim from what he's doing.
  2. The scammer hopes to convince the scammer that his account has more money, and the scam proceeds as in the first section.
Unfortunately, it's pretty much impossible to distinguish between this and a legitimate transfer, so you can't really use an automated method here like the first method. However, there are steps that you can take to protect your customers. I will discuss this in the following section.

Recommended Measures for Banks and Other Financial Institutions

As a somewhat experienced Full Stack Dev, I do have a few recommended actions. My personal philosophy with this is to do EVERYTHING reasonably possible to alert and protect the customer.

Ideas for Scambaiters Making Fake Websites

I decided to add this section because scambaiting seems to be one of the most effective ways of dealing with scammers. (I mean, it's not like their government is doing anything about it.) This list is not meant to be exhaustive by any means. Though I do have a lot of ideas for nasty tricks, I want to keep this article short. This is just meant to give scambaiters some inspiration.

Conclusion

These types of scams are becoming more and more prevalent. A simple solution like this can easily put a stop to them, or at least slow them down long enough for the customer to become suspicious.